package org.example.projecttwo.entity.dto.content.request;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

@Data
@Schema(description = "评论操作DTO，用于评论的新增和回复")
public class CommentDTO {

    @NotNull(message = "用户ID不能为空")
    @Schema(description = "评论用户ID", example = "1001")
    private Long userId;

    @NotNull(message = "内容类型不能为空")
    @Schema(description = "内容类型：1-文章，2-新闻", example = "1")
    private Integer contentType;

    @NotNull(message = "内容ID不能为空")
    @Schema(description = "被评论的内容ID（文章ID或新闻ID）", example = "2001")
    private Long contentId;

    @NotBlank(message = "评论内容不能为空")
    @Schema(description = "评论内容", example = "这篇文章写得很有见解！")
    private String content;

    @Schema(description = "父评论ID，用于回复功能，顶级评论为null", example = "3001")
    private Long parentId;
}